var container=document.getElementById('screen');
var ul=container.children[0];
var ol=container.children[1];
var pointArr=ol.children;var prev=container.children[2].children[0];
var next=container.children[2].children[1];
var width=ul.children[0].offsetWidth;
var newLi=ul.children[0].cloneNode(true);
var liArr=ul.children;
ul.appendChild(newLi);
var key=0;
var index=0;
 for(var i=0;i<pointArr.length;i++){
            pointArr[i].onclick=function(){
                key=this.innerHTML-1;
                index=key;
                move(ul,'left',-index*width);
                light(key);
            }
        }       
        next.onclick=autoplay;
        prev.onclick=function(){
            index--;
            key--;
            key=key<0?pointArr.length-1:key;
            if(index<0){
                index=liArr.length-2;
                ul.style.left=-(liArr.length-1)*width;
            }
            move(ul,'left',-index*width)
            light(key);
        }
        var timer3=setInterval(autoplay,2000);
        container.onmouseenter=function(){
            clearInterval(timer3);
        }
        container.onmouseleave=function(){
            clearInterval(timer3);
            timer3=setInterval(autoplay,2000);
        }
        function autoplay(){
            index++;
            key++;
            key=key>pointArr.length-1?0:key;
            if(index>liArr.length-1){
                index=1;
                ul.style.left=0;
            }
            move(ul,'left',-index*width);
            light(key);
        }
        function light(num){
            for(var i=0;i<pointArr.length;i++){
                pointArr[i].className='';
            }
            pointArr[num].className='current';
        }        